<?php
global $contact_basic_properties_setting;

$contact_basic_properties_setting = contact_basic_properties_setting();

function contact_property_render($property_key) {
	global $contact_basic_properties_setting;
	
	$property_settings = $contact_basic_properties_setting[$property_key];
	
	//Render nav tabs
	$render_html = "<div id='{$property_key}-settings' class='element-settings'>";
	$render_html .= "<h2>Render " . $property_key . " </h2>";
	$render_html .= "<ul class=\"nav nav-tabs nav-justified\" role=\"tablist\">";
	$count = 0;
	foreach ($property_settings as $key => $group_types) {
		$render_html .= $count > 0 ? "<li>" : "<li class=\"active\">";
		$render_html .= "<a data-target=\".".$group_types['id']."\" role=\"tab\" data-toggle=\"tab\">".$group_types['text']."</a></li>";
		$count ++;
	}
	$render_html .= "</ul>";
	
	//Render tab panes
	$render_html .= "<div class=\"tab-content nino-hideScroll\">";
	$count = 0;
	foreach ($property_settings as $key => $group_types) {
		$render_html .= "<div class=\"tab-pane nino-viewport " . ($count > 0 ? "" : "active") . " ".$group_types['id']."\">";
		foreach ($group_types['groups'] as $cname => $groups) {
			$render_html .= "<div class=\"".$groups['cols']."\">";
			foreach ($groups['atts'] as $property) {
				$render_html .= "<div class=\"nino-grid-col ".$property."\">";
				$render_html .= basic_property_render($property);
				$render_html .= "</div>";
			}
			$render_html .= "</div>";
		}
		$render_html .= "</div>";
		$count ++;
	}
	$render_html .= "</div></div>";

	return $render_html;
}

/** =============================================================================================================================================================================== 
 * Basic Level Properties
 * =============================================================================================================================================================================== */
function basic_property_render($type) {
	$render_property_html = "";
	
	switch ($type) {
		case "label-text":
			$render_property_html = basic_property_label_text_render();
			break;
			
		case "sub-text":
			$render_property_html =  basic_property_sub_text_render();
			break;
		
		case "label-icon":
			$render_property_html = basic_property_label_icon_render();
			break;
			
		case "label-position":
			$render_property_html = basic_property_label_position_render();
			break;
		
		case "fonts":
			$render_property_html = basic_property_fonts_render();
			break;
			
		case "font-size":
			$render_property_html = basic_property_font_size_render();
			break;

		case "placeholder":
			$render_property_html = basic_property_placeholder_render();
			break;

		case "input-value":
			$render_property_html = basic_property_input_value_render();
			break;

		case "input-icon":
			$render_property_html = basic_property_input_icon_render();
			break;
			
		case "width":
			$render_property_html = basic_property_width_render();
			break;
		
		case "height":
			$render_property_html = basic_property_height_render();
			break;
			
		case "maximum-characters":
			$render_property_html = basic_property_maximum_characters_render();
			break;

		case "list-of-choice":
			$render_property_html = basic_property_list_of_choice_render();
			break;
	
		case "alignment":
			$render_property_html = basic_property_alignment_render();
			break;
			
		case "input-size":
			$render_property_html = basic_property_input_size_render();
			break;
			
		case "input-text-color":
			$render_property_html = basic_property_input_text_color_render();
			break;
			
		case "input-background-color":
			$render_property_html = basic_property_input_background_color_render();
			break;
			
		case "border-color":
			$render_property_html = basic_property_border_color_render();
			break;
			
		case "border-width":
			$render_property_html = basic_property_border_width_render();
			break;
			
		case "border-radius":
			$render_property_html = basic_property_border_radius_render();
			break;
			
		case "styles":
			$render_property_html = basic_property_styles_render();
			break;
			
		case "display":
			$render_property_html = basic_property_display_render();
			break;
		
		case "icon-position":
			$render_property_html = basic_property_icon_position_render();
			break;
			
		case "refresh-icon":
			$render_property_html = basic_property_refresh_icon_render();
			break;
		
		case "horizontal":
			$render_property_html = basic_property_horizontal_render();
			break;	
			
		case "captcha-style":
			$render_property_html = basic_property_captcha_style_render();
			break;
			
		case "heading-text":
			$render_property_html = basic_property_heading_text_render();
			break;
			
		case "heading-icon":
			$render_property_html = basic_property_heading_icon_render();
			break;
			
		case "icon-size":
			$render_property_html = basic_property_icon_size_render();
			break;
			
		case "text-content":
			$render_property_html = basic_property_text_content_render();
			break;
			
		case "effects":
			$render_property_html = basic_property_effect_render();
			break;
			
		case "image-url":
			$render_property_html = basic_property_image_url_render();
			break;
			
		case "divider-color":
			$render_property_html = basic_property_divider_color_render();
			break;
			
		case "submit-text":
			$render_property_html = basic_property_submit_text_render();
			break;
			
		case "social-links":
			$render_property_html = basic_property_social_links_render();
			break;
			
		case "required":
			$render_property_html = basic_property_required_render();
			break;
			
		case "required-message":
			$render_property_html = basic_property_required_message_render();
			break;
			
		default:
			$render_property_html = $type;
			break;
	}
	
	return $render_property_html;
}

function basic_property_label_text_render() {
	$settings = array(
		'label' => array(
			'text' => 'Label text',
		),
		'parent' => array(
			'class' => 'nino-input',
		),
		'input' => array(
			'name' => 'label-text',
			'value' => 'Label text',
		),
		'div' => array(
			'class' => 'nino-color-box'
		)
	);
	
	$render_property_html = lowest_level_property_text_with_color($settings);
	
	return $render_property_html;
}

function basic_property_sub_text_render() {
	$settings = array(
		'label' => array(
			'text' => 'Sub text',
		),
		'parent' => array(
			'class' => 'nino-input',
		),
		'input' => array(
			'name' => 'sub-text',
			'value' => 'Sub text',
		),
		'div' => array(
			'class' => 'nino-color-box'
		)
	);
	
	$render_property_html = lowest_level_property_text_with_color($settings);
	
	return $render_property_html;
}

function basic_property_label_icon_render() {
	$settings = array(
		'label' => array(
			'text' => 'Label icon',
		),
		'parent' => array(
			'class' => 'nino-input',
		),
		'input' => array(
			'name' => 'label-icon',
			'class' => 'nino-font-box',
		),
		'div' => array(
			'class' => 'nino-color-box'
		)
	);
	
	$render_property_html = lowest_level_property_text_with_color($settings);
	
	return $render_property_html;
}

function basic_property_label_position_render() {
	$settings = array(
		'label' => array(
			'text' => 'Label Position',
		),
		'radio' => array(
			'name' => 'label-position',
			'class' => 'nino-grid-layout-3',
			'options' => array(
				'none' => array(
					'text' => 'None',
					'value' => 'none',
				),
				'left' => array(
					'text' => 'Left',
					'value' => 'left',
				),
				'top' => array(
					'text' => 'Top',
					'value' => 'top',
				),
			)
		)
	);
	
	$render_property_html = lowest_level_property_radio($settings);
	
	return $render_property_html;
}

function basic_property_fonts_render() {
	$settings = array(
		'label' => array(
			'text' => 'Fonts',
		),
		'select' => array(
			'name' => 'fonts',
			'class' => 'nino-select-box-style',
			'options' => array(
				'aria' => array(
					'text' => 'Helvetica,Arial,sans-serif',
					'value' => 'Helvetica,Arial,sans-serif',
				),
				'serif' => array(
					'text' => 'Serif',
					'value' => 'serif',
				),
			)
		)
	);
	
	$render_property_html = lowest_level_property_select($settings);
	
	return $render_property_html;
}

function basic_property_font_size_render() {
	$settings = array(
		'label' => array(
			'text' => 'Font size',
		),
		'input' => array(
			'class' => 'nino-amount',
			'style' => 'border:0; color:#f6931f; display: inline-block;'
		),
		'slider' => array(
			'class' => 'nino-slider-range-max',
		)
	);
	
	$render_property_html = lowest_level_property_slider($settings);
	
	return $render_property_html;
}

function basic_property_placeholder_render() {
	$settings = array(
		'label' => array(
			'text' => 'Placeholder',
		),
		'input' => array(
			'name' => 'placeholder',
			'value' => 'placeholder',
		)
	);
	
	$render_property_html = lowest_level_property_input($settings);
	
	return $render_property_html;
}

function basic_property_input_value_render() {
	$settings = array(
		'label' => array(
			'text' => 'Input value',
		),
		'input' => array(
			'name' => 'input-value',
			'value' => 'Input Value',
		)
	);
	
	$render_property_html = lowest_level_property_input($settings);
	
	return $render_property_html;
}

function basic_property_input_icon_render() {
	$settings = array(
		'label' => array(
			'text' => 'Input Icon',
		),
		'parent' => array(
			'class' => 'nino-input',
		),
		'input' => array(
			'name' => 'input-icon',
			'class' => 'nino-font-box',
		),
		'div' => array(
			'class' => 'nino-color-box'
		)
	);
	
	$render_property_html = lowest_level_property_text_with_color($settings);
	
	return $render_property_html;
}

function basic_property_width_render() {
	$settings = array(
		'label' => array(
			'text' => 'Width (Px)',
		),
		'input' => array(
			'name' => 'width',
			'value' => '200',
			'type' => "number",
		)
	);
	
	$render_property_html = lowest_level_property_input($settings);
	
	return $render_property_html;
}

function basic_property_height_render() {
	$settings = array(
		'label' => array(
			'text' => 'Height (Px)',
		),
		'input' => array(
			'name' => 'height',
			'value' => '200',
		)
	);
	
	$render_property_html = lowest_level_property_input($settings);
	
	return $render_property_html;
}

function basic_property_maximum_characters_render() {
	$settings = array(
		'label' => array(
			'text' => 'Maximum Characters',
		),
		'input' => array(
			'name' => 'maximum-characters',
			'value' => '200',
		)
	);
	
	$render_property_html = lowest_level_property_input($settings);
	
	return $render_property_html;
}

function basic_property_required_render() {
	$settings = array(
		'label' => array(
			'text' => 'Required',
		),
		'radio' => array(
			'name' => 'required',
			'class' => 'nino-grid-layout-3',
			'options' => array(
				'no' => array(
					'text' => 'No',
					'value' => 'no',
				),
				'yes' => array(
					'text' => 'Yes',
					'value' => 'yes',
				),
			)
		)
	);
	
	$render_property_html = lowest_level_property_radio($settings);
	
	return $render_property_html;
}

function basic_property_required_message_render() {
	$settings = array(
		'label' => array(
			'text' => 'Required Message',
		),
		'parent' => array(
			'class' => 'nino-input',
		),
		'input' => array(
			'name' => 'require-message',
			'value' => 'This is a required field',
		),
		'div' => array(
			'class' => 'nino-color-box'
		)
	);
	
	$render_property_html = lowest_level_property_text_with_color($settings);
	
	return $render_property_html;
}

function basic_property_list_of_choice_render() {
	$settings = array(
		'label' => array(
			'text' => 'List Of Choice',
		),
		'select' => array(
			'options' => array(
				'option1' => array(
					'name' => 'Custom Text',
					'value' => 'Custom Value',
				),
			),
			'action' => array(
				'name' => 'nino-selectbox-listOfChoice-group',
				'class' => 'nino-listOfChoiceAction',
				'default' => 'option1',
			)
		),
		'button' => array(
			'class' => 'nino-addMoreChoice',
			'text' => 'Add more',
		)
	);
	
	$render_property_html = lowest_level_property_list_option($settings);
	
	return $render_property_html;
}

function basic_property_alignment_render() {
	$settings = array(
		'label' => array(
			'text' => 'Alignment',
		),
		'radio' => array(
			'name' => 'alignment',
			'class' => 'nino-grid-layout-4',
			'options' => array(
				'left' => array(
					'text' => 'Left',
					'value' => 'left',
				),
				'center' => array(
					'text' => 'Center',
					'value' => 'center',
				),
				'right' => array(
					'text' => 'Right',
					'value' => 'right',
				),
				'justify' => array(
					'text' => 'Justify',
					'value' => 'justify',
				),
			)
		)
	);
	
	$render_property_html = lowest_level_property_radio($settings);
	
	return $render_property_html;
}

function basic_property_input_size_render() {
	$settings = array(
		'label' => array(
			'text' => 'Input Size',
		),
		'radio' => array(
			'name' => 'input-size',
			'class' => 'nino-grid-layout-3',
			'options' => array(
				'small' => array(
					'text' => 'Small',
					'value' => 'small',
				),
				'medium' => array(
					'text' => 'Medium',
					'value' => 'medium',
				),
				'large' => array(
					'text' => 'Large',
					'value' => 'large',
				),
			)
		)
	);
	
	$render_property_html = lowest_level_property_radio($settings);
	
	return $render_property_html;
}

function basic_property_input_text_color_render() {
	$settings = array(
		'label' => array(
			'text' => 'Input Text Color',
		),
		'parent' => array(
			'class' => 'nino-input nino-input-color',
		),
		'input' => array(
			'name' => 'input-text-color',
			'class' => 'nino-input-color-box',
		),
		'div' => array(
			'class' => 'nino-input-color-display'
		)
	);
	
	$render_property_html = lowest_level_property_text_with_color($settings);
	
	return $render_property_html;
}

function basic_property_input_background_color_render() {
	$settings = array(
		'label' => array(
			'text' => 'Input Background Color',
		),
		'parent' => array(
			'class' => 'nino-input nino-input-color',
		),
		'input' => array(
			'name' => 'input-background-color',
			'class' => 'nino-input-color-box',
		),
		'div' => array(
			'class' => 'nino-input-color-display'
		)
	);
	
	$render_property_html = lowest_level_property_text_with_color($settings);
	
	return $render_property_html;
}

function basic_property_border_color_render() {
	$settings = array(
		'label' => array(
			'text' => 'Border Color',
		),
		'parent' => array(
			'class' => 'nino-input nino-input-color',
		),
		'input' => array(
			'name' => 'input-border-color',
			'class' => 'nino-input-color-box',
		),
		'div' => array(
			'class' => 'nino-input-color-display'
		)
	);
	
	$render_property_html = lowest_level_property_text_with_color($settings);
	
	return $render_property_html;
}

function basic_property_border_width_render() {
	$settings = array(
		'label' => array(
			'text' => 'Border Width',
		),
		'input' => array(
			'class' => 'nino-amount',
			'style' => 'border:0; color:#f6931f; display: inline-block;'
		),
		'slider' => array(
			'class' => 'nino-slider-range-max',
		)
	);
	
	$render_property_html = lowest_level_property_slider($settings);
	
	return $render_property_html;
}

function basic_property_border_radius_render() {
	$settings = array(
		'label' => array(
			'text' => 'Border Radius',
		),
		'input' => array(
			'class' => 'nino-amount',
			'style' => 'border:0; color:#f6931f; display: inline-block;'
		),
		'slider' => array(
			'class' => 'nino-slider-range-max',
		)
	);
	
	$render_property_html = lowest_level_property_slider($settings);
	
	return $render_property_html;
}

function basic_property_styles_render() {
	$settings = array(
		'label' => array(
			'text' => 'Style',
		),
		'select' => array(
			'name' => 'styles',
			'class' => 'nino-select-box-style',
			'options' => array(
				'style1' => array(
					'text' => 'Style 1',
					'value' => 'style-1',
				),
				'style2' => array(
					'text' => 'Style 2',
					'value' => 'style-2',
				),
				'style3' => array(
					'text' => 'Style 3',
					'value' => 'style-3',
				),
			)
		)
	);
	
	$render_property_html = lowest_level_property_select($settings);
	
	return $render_property_html;
}

function basic_property_display_render() {
	$settings = array(
		'label' => array(
			'text' => 'Display',
		),
		'radio' => array(
			'name' => 'display',
			'class' => 'nino-grid-layout-5',
			'options' => array(
				'inline' => array(
					'text' => 'Inline',
					'value' => 'display-inline',
				),
				'horizontal' => array(
					'text' => 'Horizontal',
					'value' => 'display-horizontal',
				),
				'2-cols' => array(
					'text' => '2 Cols',
					'value' => 'display-2-cols',
				),
				'3-cols' => array(
					'text' => '3 Cols',
					'value' => 'display-3-cols',
				),
				'4-cols' => array(
					'text' => '4 Cols',
					'value' => 'display-4-cols',
				),
			)
		)
	);
	
	$render_property_html = lowest_level_property_radio($settings);
	
	return $render_property_html;
}

function basic_property_icon_position_render() {
	$settings = array(
		'label' => array(
			'text' => 'Icon Position',
		),
		'radio' => array(
			'name' => 'icon-position',
			'class' => 'nino-grid-layout-2',
			'options' => array(
				'left' => array(
					'text' => 'Left',
					'value' => 'nino-icon-left',
				),
				'right' => array(
					'text' => 'Right',
					'value' => 'nino-icon-right',
				),
			)
		)
	);
	
	$render_property_html = lowest_level_property_radio($settings);
	
	return $render_property_html;
}

function basic_property_refresh_icon_render() {
	$settings = array(
		'label' => array(
			'text' => 'Refresh Icon',
		),
		'parent' => array(
			'class' => 'nino-input',
		),
		'input' => array(
			'name' => 'refresh-icon',
			'class' => 'nino-font-box',
		),
		'div' => array(
			'class' => 'nino-color-box'
		)
	);
	
	$render_property_html = lowest_level_property_text_with_color($settings);
	
	return $render_property_html;
}

function basic_property_horizontal_render() {
	$settings = array(
		'label' => array(
			'text' => 'Captcha Horizontal',
		),
		'radio' => array(
			'name' => 'required',
			'class' => 'nino-grid-layout-2',
			'options' => array(
				'yes' => array(
					'text' => 'Yes',
					'value' => 'yes',
				),
				'no' => array(
					'text' => 'No',
					'value' => 'no',
				),
			)
		)
	);
	
	$render_property_html = lowest_level_property_radio($settings);
	
	return $render_property_html;
}

function basic_property_captcha_style_render() {
	$settings = array(
		'label' => array(
			'text' => 'Captcha Style',
		),
		'radio' => array(
			'name' => 'captcha-style',
			'class' => 'nino-grid-layout-3',
			'options' => array(
				'style1' => array(
					'text' => 'Style 1',
					'value' => 'style1',
				),
				'style2' => array(
					'text' => 'Style 2',
					'value' => 'style2',
				),
				'style3' => array(
					'text' => 'Style 3',
					'value' => 'style3',
				),
			)
		)
	);
	
	$render_property_html = lowest_level_property_radio($settings);
	
	return $render_property_html;
}

function basic_property_heading_text_render() {
	$settings = array(
		'label' => array(
			'text' => 'Heading text',
		),
		'parent' => array(
			'class' => 'nino-input',
		),
		'input' => array(
			'name' => 'heading-text',
			'value' => 'Heading text',
		),
		'div' => array(
			'class' => 'nino-color-box'
		)
	);
	
	$render_property_html = lowest_level_property_text_with_color($settings);
	
	return $render_property_html;
}

function basic_property_heading_icon_render() {
	$settings = array(
		'label' => array(
			'text' => 'Heading Icon',
		),
		'parent' => array(
			'class' => 'nino-input',
		),
		'input' => array(
			'name' => 'heading-icon',
			'class' => 'nino-font-box',
		),
		'div' => array(
			'class' => 'nino-color-box'
		)
	);
	
	$render_property_html = lowest_level_property_text_with_color($settings);
	
	return $render_property_html;
}

function basic_property_icon_size_render() {
	$settings = array(
		'label' => array(
			'text' => 'Icon size',
		),
		'input' => array(
			'class' => 'nino-amount',
			'style' => 'border:0; color:#f6931f; display: inline-block;'
		),
		'slider' => array(
			'class' => 'nino-slider-range-max',
		)
	);
	
	$render_property_html = lowest_level_property_slider($settings);
	
	return $render_property_html;
}

function basic_property_text_content_render() {
	$settings = array(
		'textarea' => array(
			'name' => 'text-content',
			'rows' => 6,
			'text' => "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
		)
	);
	
	$render_property_html = lowest_level_property_textarea($settings);
	
	return $render_property_html;
}

function basic_property_effect_render() {
	$settings = array(
		'label' => array(
			'text' => 'Effects',
		),
		'radio' => array(
			'name' => 'effects',
			'class' => 'nino-grid-layout-5',
			'options' => array(
				'effect1' => array(
					'text' => 'Effect 1',
					'value' => 'effect1',
				),
				'effect2' => array(
					'text' => 'Effect 2',
					'value' => 'effect2',
				),
				'effect3' => array(
					'text' => 'Effect 3',
					'value' => 'effect3',
				),
				'effect4' => array(
					'text' => 'Effect 4',
					'value' => 'effect4',
				),
				'effect5' => array(
					'text' => 'Effect 5',
					'value' => 'effect5',
				),
			)
		)
	);
	
	$render_property_html = lowest_level_property_radio($settings);
	
	return $render_property_html;
}

function basic_property_image_url_render() {
	$settings = array(
		'label' => array(
			'text' => 'Url',
		),
		'input' => array(
			'name' => 'image-url',
			'value' => 'Image Url',
		)
	);
	
	$render_property_html = lowest_level_property_input($settings);
	
	return $render_property_html;
}

function basic_property_divider_color_render() {
	$settings = array(
		'label' => array(
			'text' => 'Color',
		),
		'parent' => array(
			'class' => 'nino-input nino-input-color',
		),
		'input' => array(
			'name' => 'input-divider-color',
			'class' => 'nino-input-color-box',
		),
		'div' => array(
			'class' => 'nino-input-color-display'
		)
	);
	
	$render_property_html = lowest_level_property_text_with_color($settings);
	
	return $render_property_html;
}

function basic_property_submit_text_render() {
	$settings = array(
		'label' => array(
			'text' => 'Text',
		),
		'input' => array(
			'name' => 'submit-text',
			'value' => 'Submit',
		)
	);
	
	$render_property_html = lowest_level_property_input($settings);
	
	return $render_property_html;
}

function basic_property_social_links_render() {
	$settings = array(
		'socials' => array(
			'facebook' => array(
				'icon-color' => array(
					'label' => array(
						'text' => 'Social icon / color',
					),
					'input' => array(
						'class' => 'nino-font-box'
					)
				),
				'size' => array(
					'label' => array(
						'text' => 'Size',
					),
					'input' => array(
						'class' => 'nino-amount',
						'style' => 'border:0; color:#f6931f; display: inline-block;'
					),
					'slider' => array(
						'class' => 'nino-slider-range-max',
					)
				),
				'link-url' => array(
					'input' => array(
						'class' => 'nino-input nino-socialLinkUrl',
						'placeholder' => 'Social Link Here'
					)
				) 
			),
			'twitter' => array(
				'icon-color' => array(
					'label' => array(
						'text' => 'Social icon / color',
					),
					'input' => array(
						'class' => 'nino-font-box'
					)
				),
				'size' => array(
					'label' => array(
						'text' => 'Size',
					),
					'input' => array(
						'class' => 'nino-amount',
						'style' => 'border:0; color:#f6931f; display: inline-block;'
					),
					'slider' => array(
						'class' => 'nino-slider-range-max',
					)
				),
				'link-url' => array(
					'input' => array(
						'class' => 'nino-input nino-socialLinkUrl',
						'placeholder' => 'Social Link Here'
					)
				) 
			),
		),
		'add-social' => array(
			'class' => 'nino-addMoreChoice',
			'icon' => 'fa-plus',
			'text' => 'Add new social',
		)
	);
	
	$render_property_html = lowest_level_property_social($settings);
	
	return $render_property_html;
}

/** =============================================================================================================================================================================== 
 * Lowest Level Properties
 * =============================================================================================================================================================================== */
function lowest_level_property_text_with_color($settings) {
	$render_html = <<<EOD
	<div class="nino-formGroup">
		<label>{$settings['label']['text']}</label>
		<div class="{$settings['parent']['class']}">
EOD;

	$render_html .= "<input name='" .$settings["input"]["name"] ."' type='text' ";
	
	if (isset($settings['input']['value'])) {
		$render_html .= "value='".$settings['input']['value']."' ";
	}
	
	if (isset($settings['input']['class'])) {
		$render_html .= "class='".$settings['input']['class']."' ";
	}
	
	$render_html .= " />";
	
	$render_html .= <<<EOD
			<div class="{$settings['div']['class']}"></div>
		</div>
	</div>
EOD;
	
	return $render_html;
}

function lowest_level_property_radio($settings) {
	$render_html = <<<EOD
	<div class="nino-formGroup">
		<label>{$settings['label']['text']}</label>
		<div class="nino-input radioHidden">
			<div class="{$settings['radio']['class']}">
EOD;

	foreach ($settings['radio']['options'] as $key => $option) {
		$render_html .= <<<EOD
				<div class="nino-grid-col">
					<input type="radio" name="{$settings['radio']['name']}" value="{$option['value']}">
					<label for="nino-label-position-1">
						<span>{$option['text']}</span>
					</label>
				</div>
EOD;
	}
	
	$render_html .= <<<EOD
			</div>
		</div>
	</div>
EOD;
	
	return $render_html;
}

function lowest_level_property_select($settings) {
	$render_html = <<<EOD
	<div class="nino-formGroup">
		<label>{$settings['label']['text']}</label>
		<div class="nino-input {$settings['select']['class']}">
			<select name="{$settings['select']['name']}">
EOD;

	foreach ($settings['select']['options'] as $key => $option) {
		$render_html .= "<option value=\"".$option['value']."\">".$option['text']."</option>";
	}
	
	$render_html .= <<<EOD
			</select>
			<i></i>
		</div>
	</div>
EOD;
	
	return $render_html;
}

function lowest_level_property_slider($settings) {
	$render_html = <<<EOD
	<div class="nino-formGroup nino-slider-range">
		<label>{$settings['label']['text']} <input type="text" class="{$settings['input']['class']}" readonly style="{$settings['input']['style']}"></label>
		<div class="nino-input">
			<div class="{$settings['slider']['class']}"></div>
		</div>
	</div>
EOD;

	return $render_html;
}

function lowest_level_property_input($settings) {
	$type = isset($settings['type']) ? type : "text";
	$render_html = <<<EOD
	<div class="nino-formGroup">
		<label>{$settings['label']['text']}</label>
		<div class="nino-input">
			<input type="{$type}" value="{$settings['input']['value']}" name="{$settings['input']['name']}" />
		</div>
	</div>
EOD;

	return $render_html;
}

function lowest_level_property_list_option($settings) {
	
	$render_html = <<<EOD
	<div class="nino-formGroup">
		<label>{$settings['label']['text']}</label>
		<div class="nino-input">
			<ul class="options-destination">
			</ul>
		</div>
		<a href="#" class="{$settings['button']['class']}"><span class="fa fa-plus"></span> {$settings['button']['text']}</a>
		<ul class="options-source-clone nino-hidden" style="display: none;">
EOD;

	$option = $settings['select']['options']['sample'];
	$render_html .= <<<EOD
			<li id="option-__id__" class="type-radio">
				<div class="nino-grid-layout-3">
					<div class="nino-grid-col">
						<input type="text" value="{$option['name']}" placeholder="Enter Name" name="name">
					</div>
					<div class="nino-grid-col">
						<input type="text" value="{$option['value']}" placeholder="Enter Value" name="value">
					</div>
					<div class="nino-grid-col">
						<div class="{$settings['select']['action']['class']}">
							<div class="nino-input-style">
								<input type="radio" id="__id__" name="{$settings['select']['action']['name']}" value="option-__id__">
								<label for="__id__"></label>
							</div>
							<span class="fa fa-close"></span>
							<span class="fa fa-arrows"></span>
						</div>
					</div>
				</div>
			</li>
			<li id="option-__id__" class="type-checkbox">
				<div class="nino-grid-layout-3">
					<div class="nino-grid-col">
						<input type="text" value="{$option['name']}" placeholder="Enter Name" name="name">
					</div>
					<div class="nino-grid-col">
						<input type="text" value="{$option['value']}" placeholder="Enter Value" name="value">
					</div>
					<div class="nino-grid-col">
						<div class="{$settings['select']['action']['class']}">
							<div class="nino-input-style">
								<input type="checkbox" id="__id__" name="{$settings['select']['action']['name']}" value="option-__id__">
								<label for="__id__"></label>
							</div>
							<span class="fa fa-close"></span>
							<span class="fa fa-arrows"></span>
						</div>
					</div>
				</div>
			</li>
EOD;
	
	$render_html .= <<<EOD
		</ul>
	</div>
EOD;

	return $render_html;
}

function lowest_level_property_textarea($settings) {
	
	$render_html = <<<EOD
	<div class="nino-formGroup">
		<textarea rows="{$settings['textarea']['rows']}" name="{$settings['textarea']['name']}">{$settings['textarea']['text']}</textarea>
	</div>
EOD;
	
	return $render_html;
}

function lowest_level_property_social($settings) {
	$render_html = <<<EOD
	<div class="nino-formGroup">
		<div class="nino-input">
			<ul class="social-destination">
			</ul>
			<div class="nino-grid-layout-1">
				<div class="nino-grid-col">
					<a href="#" class="{$settings['add-social']['class']}"><span class="fa {$settings['add-social']['icon']}"></span> {$settings['add-social']['text']}</a>
					<ul class="social-source-clone" style="display: none;">
EOD;
	foreach ($settings['socials'] as $id => $social) {
		$render_html .= <<<EOD
						<li id="social-__id__" class="type-social">
							<span class="fa fa-close nino-removeSocial" title="remove"></span>
							<div class="nino-grid-layout-2">
								<div class="nino-grid-col">
									<div class="nino-formGroup">
										<label>{$social['icon-color']['label']['text']}</label>
										<div class="nino-input">
											<input type="text" class="{$social['icon-color']['input']['class']}" />
											<div class="nino-color-box"></div>
										</div>
									</div>
								</div>
								<div class="nino-grid-col">
									<div class="nino-formGroup nino-slider-range">
										<label>{$social['size']['label']['text']} <input type="text" class="{$social['size']['input']['class']}" readonly style="{$social['size']['input']['style']}"></label>
										<div class="nino-input">
											<div class="{$social['size']['slider']['class']}"></div>
										</div>
									</div>
								</div>
							</div>
							<div class="nino-grid-layout-1">
								<div class="nino-grid-col">
									<div class="{$social['link-url']['input']['class']}">
										<input type="text" placeholder="{$social['link-url']['input']['placeholder']}" />
									</div>
								</div>
							</div>
						</li>
EOD;
	}
	
	$render_html .= <<<EOD
					</ul>
				</div>
			</div>
		</div>
	</div>
EOD;
	
	return $render_html;
}